Introduction

Private-key cryptography uses the same secret key for both encryption and decryption. It is important that modern cryptography is usually concerned entirely with the encryption and decryption of binary data, i.e. binary strings. That is why both the message, the key and the encrypted message are represented as binary strings of 1s and 0s.

A private-key encryption scheme has an algorithm for encryption and decryption. The message to be encrypted is called the plaintext and the resulting string after encryption is called the ciphertext.

Formal Definition: Shannon Cipher

Given a key-length , a plaintext length function and a ciphertext length function , a valid private-key encryption scheme or Shannon cipher is a pair of polynomial-time computable functions such that for every key and plaintext , it is true that:

The first parameter, i.e. the key , can also be denoted as a subscript - and .

The set of all possible keys is called the key space and is denoted by . The set of all possible plaintexts is called the message space and is denoted by . The set of all possible ciphertexts is called the ciphertext space and is denoted by .

Definition Breakdown

The encryption function is denoted by and the decryption function is called . The first function, , takes a key and a plaintext and outputs a ciphertext , while the latter, , does the opposite - it takes a key and a ciphertext and produces the plaintext which was encrypted to get the ciphertext.

The key , the plaintext and the ciphertext are all binary strings and their lengths, i.e. the number of bits in them, are denoted by , and , respectively. For simplicity, these are often substituted by just , and .

The term polynomial-time computable means that the encryption and decryption functions should be fast to compute for long keys and messages, which is not an unreasonable requirement. After all, encryption and decryption would be useless if we could never hide or see the message's contents, even if they were intended for us.

The final requirement, i.e. that , is essential and is called the correctness property. It tells us that under any Shannon cipher, the encryption function is one-to-one which means that every no two plaintexts can be encrypted to the same ciphertext if the same key is used. It might seem obvious that this should be true, but it is not the case for hash functions, for example, and so hash functions are not valid private-key encryption schemes.